package baidu.qiuzhao;

import java.util.Scanner;

public class Main1 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        scanner.nextLine();
        String str=scanner.nextLine();
        int ans=0;
        int d=0;
        while(d<n&&d!=-1){
            d=str.indexOf("longlong",d);
//            System.out.println(d);
            if(d<n&&d!=-1){
                ans++;
                d+=4;
            }
        }
        System.out.println(ans);
    }
}
